<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>使用DWR调用java类中的方法</title>
		<script type='text/javascript' src='<%=path%>/dwr/interface/MyTest.js'></script>
		<script type="text/javascript" language="javascript"
			src="<%=path%>/dwr/engine.js"></script>
		<script type="text/javascript" language="javascript"
			src="<%=path%>/dwr/util.js"></script>
		<script type="text/javascript">
				var mycall=function callBack(data){  
       			DWRUtil.setValue("Info",data);
       			//dwr.util.setValue("Info",data);  //或：$(Info).value=data; 相当于document.getElementById("info").value=data;
   				 }    
			   function showInfo(){   
			       MyTest.getShowInfo(mycall);   
			   }   
			    function clearInfo(){   
			        $(Info).value="";   
			   }  
</script>
	</head>
	<body>
		<h1>
			使用DWR调用java类中的方法
		</h1>
		<input type="button" value="显示信息" onclick="javascript:showInfo()">
		<input type="button" value="清空" onclick="javascript:clearInfo()">
		<br>
		<br>
		<input type="text" id="Info">
		<br>
	</body>
</html>
